<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateProjects extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('projects', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment('项目名称');
            $table->string('db_connection')->default('mysql')->comment('数据库类型');
            $table->string('db_host')->comment('数据库地址');
            $table->string('db_port')->default('3306')->comment('数据库端口');
            $table->string('db_database')->comment('数据库');
            $table->string('db_username')->comment('数据库用户');
            $table->string('db_password')->comment('数据库密码');
            $table->string('db_prefix')->nullable('')->comment('数据表前缀');
            $table->string('prune_rule')->default('24')->comment('删除规则');
            $table->unsignedTinyInteger('delete_status')->default(1)->comment('状态');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('projects');
    }
}
